<?php
/**
Exibe um formul�rio com os campos para o cadastro de um fornecedor no banco de dados.
*/

if(!isset($_SESSION))
{
   session_start();
}

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( 0, 4 ) );

// Descri��es da Ajuda
$ajudaTipo = 'showhint("A qual tipo pertence o fornecedor a ser cadastrado. Op��es: Material ou Servi�o.", this, event, "270px");';
$ajudaCategoria = 'showhint("Categoria que pertence o fornecedor.", this, event, "200px");';
$ajudaNome = 'showhint("Nome do fornecedor.", this, event, "100px");';
$ajudaCNPJCPF = 'showhint("Digite o CNPJ/CPF do fornecedor sem pontos ou tra�os.", this, event, "100px");';
$ajudaTelefone = 'showhint("Telefone para contato do fornecedor. Formato: DDD+N�mero", this, event, "100px");';
$ajudaCelular = 'showhint("Celular para contato do fornecedor. Formato: DDD+N�mero", this, event, "100px");';
$ajudaEstado = 'showhint("Estado de residencia do fornecedor.", this, event, "100px");';
$ajudaCidade = 'showhint("Cidade de residencia do fornecedor.", this, event, "100px");';
$ajudaEmail = 'showhint("Email de contato do fornecedor.", this, event, "100px");';
$ajudaSite = 'showhint("Site de informa��o do fornecedor.", this, event, "100px");';
$ajudaRazaosocial = 'showhint("Raz�o social da empresa.", this, event, "100px");';
?>
<html>
           <head>
           <title>SAEO - Cadastro de Fornecedor</title>
           <script type='text/javascript' src='templates/hintbox.js'></script>
           <link rel='stylesheet' type='text/css' href='templates/estilos.css'>
           <script type='text/javascript' src='templates/js.js'></script>
           <script type='text/javascript' src='templates/ajax.js'></script>
           <script type='text/javascript' src='templates/setor.js'></script>
           <script type='text/javascript' src='templates/validacoes.js'></script>
           <script type='text/javascript' src='templates/fornecedor.js'></script>
           <script type='text/javascript' src='templates/geral.js'></script>
           </head>
     <body class='body' onunload="">
     <form name='cadastrarFornecedor' action='EnviarDadosFornecedor.php?operacao=4' method='post' id='cadastrarFornecedor' onsubmit='return ValidarCadastroFornecedorAuxil();'>
     <table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
              <tr>
                <td colspan='2'><?php //include "Topo.php"; ?></td>
            </tr>
            <tr>
                <td><div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>CADASTRO DE FORNECEDOR</div></td>
            </tr>
            <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
            <tr>
                <td><table class='tabela' width='650' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
                           <tr>
                               <td>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'  width='30%'>&nbsp;Tipo:</td>
                               <td><select name='tipoInformacao' id='tipoInformacao' class='inputTexto' onchange='MostrarDiv( this.value, document.getElementById("informacao")); MostrarTitulosCadastrar(this.value); CarregarCategorias(this.value);'>
                               <option value='0'>Selecione o Tipo do Cadastro</option>
                               <option value='1'>Material</option>
                               <option value='2'>Servi&ccedil;o</option>
                               </select>  <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaTipo ?>'>[?]</a>
                               </td>

                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td colspan='2'>
                                   <div id='informacao' style='display: none'>
                                        <table width='650' border='0' class='tabela' style='border-style: none' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFE3'>
                                               <tr>
                                                   <td class='textoTabelas'><span id='existente' style='margin-left:16px'></span></td>
                                                   <td></td>
                                                   <td class='textoTabelas'><span id='selecionada'></span></td>
                                               </tr>
                                               <tr>
                                                   <td style='float:right'>
                                                       <select name='listaInformacao' id='listaInformacao' class='inputTexto' size='10' style='width: 250px; height: 150px;'>
                                                       </select>
                                                       &nbsp;
                                                       &nbsp;
                                                   </td>
                                                   <td>
                                                       &nbsp;
                                                       <input type='button' value='>>' onclick='AdicionarInformacao( document.cadastrarFornecedor.listaInformacao, document.cadastrarFornecedor.listaInformacaoSelecionada );'>
                                                       <br />
                                                       <br />
                                                       &nbsp;
                                                       <input type='button' value='<<' onclick='RemoverInformacao( document.cadastrarFornecedor.listaInformacaoSelecionada, document.cadastrarFornecedor.listaInformacao );'>
                                                   </td>
                                                   <td style='float:left'>
                                                       &nbsp;
                                                       &nbsp;
                                                       <select name='listaInformacaoSelecionada' id='listaInformacaoSelecionada' class='inputTexto' size='10' style='width: 250px; height: 150px;'></select>
                                                   </td>
                                               </tr>
                                        </table>
                                   </div>
                               </td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Nome:</td>
                               <td><input type='text' name='nomeFornecedor' size='45' maxlength='150' class='inputTexto'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaNome ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;CNPJ/CPF:</td>
                               <td><input type='text' name='cnpjcpfFornecedor' size='14' maxlength='14' class='inputTexto' onkeypress='return blockNumbers(event)'> <SPAN class='textoPequeno'>Sem pontos ou tra�os</SPAN><a href='#' class='hintanchor' onMouseover='<?php echo $ajudaCNPJCPF ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Telefone:</td>
                               <td><input type='text' name='telefoneFornecedor' size='10' maxlength='10' class='inputTexto' onkeypress='return blockNumbers(event)'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaTelefone ?>'>[?]</td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>                           
                           <tr>
                               <td class='textoTabelas'>&nbsp;Telefone Comercial:</td>
                               <td><input type='text' name='telefoneComercial' size='10' maxlength='10' class='inputTexto' onkeypress='return blockNumbers(event)'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaTelefone ?>'>[?]</td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>                           
                           <tr>
                               <td class='textoTabelas'>&nbsp;Fax:</td>
                               <td><input type='text' name='faxFornecedor' size='10' maxlength='10' class='inputTexto' onkeypress='return blockNumbers(event)'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaTelefone ?>'>[?]</td>
                           </tr>                                                      
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Celular:</td>
                               <td><input type='text' name='celularFornecedor' size='10' maxlength='10' class='inputTexto' onkeypress='return blockNumbers(event)'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaCelular ?>'>[?]</td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Estado:</td>
                               <td><select name='estadoFornecedor' class='inputTexto'>
                                   <option value='0'>Selecione o estado do Fornecedor</option>
                                   <option value='AC'>Acre</option>
                                   <option value='AL'>Alagoas</option>
                                   <option value='AP'>Amap&aacute;</option>
                                   <option value='AM'>Amazonas</option>
                                   <option value='BA'>Bahia</option>
                                   <option value='CE'>Cear&aacute;</option>
                                   <option value='DF'>Distrito Federal</option>
                                   <option value='ES'>Esp&iacute;rito Santo</option>
                                   <option value='GO'>Goi&aacute;s</option>
                                   <option value='MA'>Maranh&atilde;o</option>
                                   <option value='MT'>Mato Grosso</option>
                                   <option value='MS'>Mato Grosso do Sul</option>
                                   <option value='MG'>Minas Gerais</option>
                                   <option value='PA'>Par&aacute;</option>
                                   <option value='PB'>Para&iacute;ba</option>
                                   <option value='PR'>Paran&aacute;</option>
                                   <option value='PE'>Pernambuco</option>
                                   <option value='PI'>Piau&iacute;</option>
                                   <option value='RJ'>Rio de Janeiro</option>
                                   <option value='RN'>Rio Grande do Norte</option>
                                   <option value='RS'>Rio Grande do Sul</option>
                                   <option value='RO'>Rond&ocirc;nia</option>
                                   <option value='RR'>Roraima</option>
                                   <option value='SC'>Santa Catarina</option>
                                   <option value='SP'>S&atilde;o Paulo</option>
                                   <option value='SE'>Sergipe</option>
                                   <option value='TO'>Tocantins</option>                                   
                                </select>
                                <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaEstado ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Cidade:</td>
                               <td><input type='text' name='cidadeFornecedor' size='45' maxlength='100' class='inputTexto'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaCidade ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;E-mail:</td>
                               <td><input type='text' name='emailFornecedor' size='45' maxlength='150' class='inputTexto'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaEmail ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Site:</td>
                               <td><input type='text' name='siteFornecedor' size='45' maxlength='150' class='inputTexto'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaSite ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas'>&nbsp;Raz&atilde;o Social:</td>
                               <td><input type='text' name='razaoSocialFornecedor' size='45' maxlength='150' class='inputTexto'> <a href='#' class='hintanchor' onMouseover='<?php echo $ajudaRazaosocial ?>'>[?]</a></td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td colspan='2' height='46'><div style='position:relative;left:540px'><input type='image' style='width:100px;height:30px;' onclick='EnviarInformacoes();' src='templates/btavancar.JPG'/></div></td>
                           <tr>
                     </table>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tfoot>
                   <tr>
                   	<?php //include 'rodapeCreditos.php'; ?>
                   </tr>
            </tfoot>
     </table>
     </form>
     </body>
     </html>